<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>编辑商品</title>
</head>

<body>
  <h1>编辑商品</h1>
  <form method="post" enctype="multipart/form-data">
    {% csrf_token %}
    <label for="name">商品名称:</label>
    <input type="text" name="name" value="{{ product.name }}" required><br>

    <label for="description">商品描述:</label>
    <textarea name="description" required>{{ product.description }}</textarea><br>

    <label for="price">价格:</label>
    <input type="number" name="price" step="0.01" value="{{ product.price }}" required><br>

    <label for="stock">库存:</label>
    <input type="number" name="stock" value="{{ product.stock }}" required><br>

    <label for="category">类别:</label>
    <input type="text" name="category" value="{{ product.category }}" required><br>

    <label for="brand">品牌:</label>
    <input type="text" name="brand" value="{{ product.brand }}" required><br>

    <label for="image">商品图片:</label>
    <input type="file" name="image" accept="image/*"><br>

    <button type="submit">保存更改</button>
  </form>
  <p><a href="{% url 'manage_products' %}">返回商品管理</a></p>
</body>

</html>